package xg2013.totoro.domain;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @generated
 */
@Entity
@Table(name = "post")
public class Post implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * @generated
	 */
	private String title;
	/**
	 * @generated
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	/**
	 * @generated
	 */
	private java.lang.String content;
	/**
	 * @generated
	 */
	private Boolean isTop;
	/**
	 * @generated
	 */
	@ManyToOne
	@JoinColumn(name = "previous_post_id")
	private Post previous;
	/**
	 * @generated
	 */
	@OneToMany(mappedBy = "previous",cascade = CascadeType.ALL)
	private Collection<Post> followingPosts;
	/**
	 * @generated
	 */
	@OneToOne
	@JoinColumn(name = "poster_id")
	private Actor poster;
	/**
	 * @generated
	 */
	private Calendar issueDate;
	/**
	 * @generated
	 */
	@OneToOne
	@JoinColumn(name = "graduateProject_id")
	private GraduateProject graduateProject;

	/**
	 * @generated
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id 
	 * @generated
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @generated
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param title 
	 * @generated
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @generated
	 */
	public java.lang.String getContent() {
		return content;
	}

	/**
	 * @param content 
	 * @generated
	 */
	public void setContent(java.lang.String content) {
		this.content = content;
	}

	/**
	 * @generated
	 */
	public Boolean getIsTop() {
		return isTop;
	}

	/**
	 * @param isTop 
	 * @generated
	 */
	public void setIsTop(Boolean isTop) {
		this.isTop = isTop;
	}

	/**
	 * @generated
	 */
	public Calendar getIssueDate() {
		return issueDate;
	}

	public Post getPrevious() {
		return previous;
	}

	public void setPrevious(Post previous) {
		this.previous = previous;
	}

	public Collection<Post> getFollowingPosts() {
		return followingPosts;
	}

	public void setFollowingPosts(Collection<Post> followingPosts) {
		this.followingPosts = followingPosts;
	}

	public Actor getPoster() {
		return poster;
	}

	public void setPoster(Actor poster) {
		this.poster = poster;
	}

	public GraduateProject getGraduateProject() {
		return graduateProject;
	}

	public void setGraduateProject(GraduateProject graduateProject) {
		this.graduateProject = graduateProject;
	}

	/**
	 * @param issueDate 
	 * @generated
	 */
	public void setIssueDate(Calendar issueDate) {
		this.issueDate = issueDate;
	}
	
}